package ${serviceClazz?lower_case}.dto;

import lombok.Data;

import java.util.Date;

import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.Max;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;

import io.swagger.v3.oas.annotations.media.Schema;

@Data
@Schema(description = "${tableInfo.tableComment}${serviceOpt}DTO")
public class ${serviceName?cap_first}${serviceOpt}Req {
	<#list columns as item>
	<#if (item.javaCode!="createTime"&&item.javaCode!="updateTime")>
	<#if (item.javaCode==keyColumn.javaCode && serviceOpt=="Add")>
	<#else>
	@Schema(description = "${item.columnRemark}"<#if (!item.nullAble && serviceOpt=="Add")>,requiredMode = Schema.RequiredMode.REQUIRED</#if>)
	<#if (item.javaType=="String")>
	@Size(min = 0,max = ${item.characterMaximumLength?c},message ="${item.columnRemark}字段超过限长（${item.characterMaximumLength}）")
	</#if>
	<#if (!item.nullAble) && (!item.number) && (!item.date)>
	@NotBlank(message = "${item.columnRemark}不能为空(${item.javaCode})")
	</#if>
	<#if (!item.nullAble) && (item.number) && (!item.date)>
	@NotNull(message = "${item.columnRemark}不能为空(${item.javaCode})")
	@Min(value = 0,message = "${item.javaCode}必须大于0${item.number?c}")
	</#if>
	<#if (!item.nullAble) && (item.date) && (item.javaCode!="createTime"&&item.javaCode!="updateTime")>
	@NotNull(message = "${item.columnRemark}不能为空(${item.javaCode})")
	</#if>
	private ${item.javaType} ${item.javaCode};
	</#if>
	</#if>
	</#list>
}